package com.longge;

public class FindMinimumOperations {

    public int findMinimumOperations(String s1, String s2, String s3) {
        int i = 0;
        while (i < s1.length() && i < s2.length() && i < s3.length()) {
            if (s1.charAt(i) == s2.charAt(i) && s2.charAt(i) == s3.charAt(i)) {
                i++;
            } else {
                break;
            }
        }
        if (i != 0) {
            return s1.length() - i + s2.length() - i + s3.length() - i ;

        } else {
            return -1;
        }
    }
}
